package day2.深克隆;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Stu implements Cloneable{
    String name;
    int age;
    Teacher t;

    @Override
    public Object clone() throws CloneNotSupportedException {
        Stu s = (Stu)super.clone();
        s.t = (Teacher) t.clone();
        return s;
    }
}
